package com.example.basic.web.model.menu;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.example.basic.base.IdEntity;
import com.example.basic.base.event.PreCreateEventEntity;
import com.example.basic.base.event.PreUpdateEventEntity;
import com.example.basic.utils.CommonConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;


@Data
@TableName("sys_menu")
@ApiModel(value="Menu对象", description="菜单信息")
public class Menu extends IdEntity implements PreCreateEventEntity, PreUpdateEventEntity {


    @ApiModelProperty(value = "数据id")
    @TableId(value = "id")
    private String id;

    @ApiModelProperty(value = "数据创建时间")
    @TableField(value = "create_at", fill = FieldFill.INSERT)
    @JSONField(format = CommonConstant.TIME_FORMAT_EIGHTEEN)
    private Date createAt;

    @ApiModelProperty(value = "数据创建人")
    @TableField("create_by")
    private String createBy;

    @ApiModelProperty(value = "数据修改时间")
    @TableField(value = "update_at", fill = FieldFill.UPDATE)
    @JSONField(format = CommonConstant.TIME_FORMAT_EIGHTEEN)
    private Date updateAt;

    @ApiModelProperty(value = "数据修改人")
    @TableField("update_by")
    private String updateBy;

    @ApiModelProperty("菜单编码")
    @TableField("menu_code")
    private String menuCode;

    @ApiModelProperty("菜单名称")
    @TableField("menu_name")
    private String menuName;

    @ApiModelProperty("菜单简介")
    @TableField("menu_remark")
    private String menuRemark;

    @ApiModelProperty("菜单图标")
    @TableField("menu_icon")
    private String menuIcon;

    @ApiModelProperty("菜单路径")
    @TableField("menu_url")
    private String menuUrl;

    @ApiModelProperty("路由名称")
    @TableField("router_name")
    private String routerName;

    @ApiModelProperty(value = "父级菜单编码")
    @TableField("parent_menu_code")
    private String parentMenuCode;

    @ApiModelProperty("启用标识 0:停用   1:启用")
    @TableField("enable_flag")
    private String enableFlag;

    @ApiModelProperty("是否可以添加子集 0-否 1-是")
    @TableField("add_child")
    private String addChild;

    @ApiModelProperty("删除标识  1 删除  0 未删除")
    @TableField("delete_flag")
    @TableLogic
    private String deleteFlag;

    @ApiModelProperty(value = "父级菜单名称")
    @TableField(exist = false)
    private String parentMenuName;

    @ApiModelProperty(value = "拼音码")
    @TableField("py_code")
    private String pyCode;

    @ApiModelProperty(value = "五笔码")
    @TableField("wb_code")
    private String wbCode;

    @ApiModelProperty(value = "子集菜单")
    @TableField(exist = false)
    private List<Menu> childList;

    @ApiModelProperty(value = "系统类型，1-pc端，2-移动端")
    @TableField("sys_type")
    private String sysType;
}
